<!DOCTYPE html>
<html>
<head>
    <title>js类型Type</title>
    <meta charset="utf-8"/>
    <script src="../../js/jquery-1.10.1.min.js"></script>
    <script>
        //5种简单数据类型： Undefined, Null, Boolean, Number和String
        //some意指“某些”，指是否“某些项”合乎条件。与下面的every算是好基友，every表示是否“每一项”都要靠谱。用法如下：
        //array.some(callback,[ thisObject]);
        var scores = [5, 8, 3, 10];
        var current = 7;

        function higherThanCurrent(score) {
            return score > current;
        }

        if (scores.some(higherThanCurrent)) {
            alert("朕准了！");
        }


        if (scores.every(higherThanCurrent)) {
            console.log("朕准了！");
        } else {
            console.log("来人，拖出去斩了！");
        }
    </script>
</head>
<body>
<p>js类型Type</p>
</body>
</html>